package com.rzjm.api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.rzjm.api.dao.SysUserDao;
import com.rzjm.api.dao.UserDao;
import com.rzjm.api.entity.SysUser;
import com.rzjm.api.entity.User;
import com.rzjm.api.service.SysUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUser> implements SysUserService {

    @Resource
    private UserDao userDao;
    @Resource
    private SysUserDao sysUserDao;

    @Override
    public SysUser getSysUserByUser(User user) {
        QueryWrapper<SysUser> qw = new QueryWrapper<>();
        qw.eq("user_id",user.getSysUserId());
        qw.last("limit 1");
        return sysUserDao.selectOne(qw);
    }
}
